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

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

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

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

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

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

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

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

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

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

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

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

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

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

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