class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.y: E = None
        self.q: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.x: E = None
        self.t: G = None
        self.y: A = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

l = A("l")
h = B("h")
i = C("i")
b = D("b")
d = E("d")
c = F("c")
e = G("e")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.x: E = None
        self.t: G = None
        self.y: A = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

l = A("l")
h = B("h")
i = C("i")
b = D("b")
d = E("d")
c = F("c")
e = G("e")

l.x = d
l.y = d
l.v = b
l.t = b
l.q = i
h.w = c
h.x = e
h.z = d
i.p = c
b.y = h
b.r = l
d.t = c
d.p = l
d.s = i
d.w = h
d.u = e
d.z = e
c.z = h
c.w = l
c.y = l
c.x = d
c.t = e
c.q = i
c.v = i
e.z = h
e.s = h
e.v = h
e.p = c
e.u = c
e.q = c
e.o = l
assert l.q.p.z.txt == "h"