class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.x: G = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.y: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.s: B = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.o: E = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: D = None
        self.o: F = None
        self.q: E = None
        self.txt = txt

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

b.q = d
i.p = k
i.z = k
i.x = n
i.o = n
i.u = n
k.r = i
k.y = i
k.u = f
k.q = n
d.w = c
d.r = k
d.z = k
d.s = i
d.o = n
a.v = c
a.t = i
c.r = k
c.t = a
c.o = a
c.y = a
n.v = k
n.x = d
n.o = j
n.q = f
j.r = k
j.t = f
j.y = f
j.o = a
f.v = c
f.t = i
assert f.t.x.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.x: G = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.y: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.s: B = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.o: E = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: D = None
        self.o: F = None
        self.q: E = None
        self.txt = txt

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

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