class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

g = A("g")
l = B("l")
m = C("m")
e = D("e")
a = E("a")
d = F("d")
c = B("c")
n = C("n")
f = D("f")

g.u = a
g.z = e
g.r = f
l.z = g
m.r = g
m.z = g
m.u = d
e.s = m
e.p = d
e.r = c
e.q = c
e.w = c
e.v = g
a.q = n
d.t = g
c.z = g
n.r = g
n.z = g
n.u = d
f.s = m
f.p = d
f.r = c
f.q = c
f.w = c
f.v = g
assert n.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

g = A("g")
l = B("l")
m = C("m")
e = D("e")
a = E("a")
d = F("d")
c = B("c")
n = C("n")
f = D("f")

g.u = a
g.z = e
g.r = f
l.z = g
m.r = g
m.z = g
m.u = d
e.s = m
e.p = d
e.r = c
e.q = c
e.w = c
e.v = g
a.q = n
d.t = g
c.z = g
n.r = g
n.z = g
n.u = d
f.s = m
f.p = d
f.r = c
f.q = c
f.w = c
f.v = g
assert n.u.t.u.txt == "a"