class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.z: F = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

a = A("a")
e = B("e")
b = C("b")
g = D("g")
d = E("d")
c = F("c")
j = C("j")

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.z: F = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

a = A("a")
e = B("e")
b = C("b")
g = D("g")
d = E("d")
c = F("c")
j = C("j")

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