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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: A = None
        self.o: A = None
        self.s: E = None
        self.z: A = None
        self.t: C = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.v: F = None
        self.w: E = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.s: E = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: A = None
        self.o: A = None
        self.s: E = None
        self.z: A = None
        self.t: C = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.v: F = None
        self.w: E = None
        self.y: B = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.s: E = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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