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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.u: C = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.u: C = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

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

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