class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: B = None
        self.q: A = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: E = None
        self.u: F = None
        self.y: E = None
        self.q: B = None
        self.v: E = None
        self.p: D = None
        self.txt = txt

c = A("c")
g = B("g")
i = C("i")
j = D("j")
b = E("b")
f = F("f")
d = G("d")

c.v = i
c.o = d
c.s = b
c.t = g
g.q = b
i.x = d
i.r = d
i.w = g
i.q = c
j.t = d
j.s = d
j.y = f
b.s = i
b.x = g
b.o = g
f.p = c
f.x = c
f.s = g
d.z = g
d.q = g
d.s = b
d.y = b
d.v = b
d.u = f
d.p = j
assert f.p.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.s: E = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: B = None
        self.q: A = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: E = None
        self.u: F = None
        self.y: E = None
        self.q: B = None
        self.v: E = None
        self.p: D = None
        self.txt = txt

c = A("c")
g = B("g")
i = C("i")
j = D("j")
b = E("b")
f = F("f")
d = G("d")

c.v = i
c.o = d
c.s = b
c.t = g
g.q = b
i.x = d
i.r = d
i.w = g
i.q = c
j.t = d
j.s = d
j.y = f
b.s = i
b.x = g
b.o = g
f.p = c
f.x = c
f.s = g
d.z = g
d.q = g
d.s = b
d.y = b
d.v = b
d.u = f
d.p = j
assert f.p.o.q.txt == "g"