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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

n.r = e
n.y = a
a.u = e
a.t = m
m.u = a
i.y = a
i.t = a
e.r = d
d.s = n
d.z = n
d.r = a
d.t = a
d.p = m
d.u = i
c.r = e
c.y = a
assert e.r.p.u.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

n.r = e
n.y = a
a.u = e
a.t = m
m.u = a
i.y = a
i.t = a
e.r = d
d.s = n
d.z = n
d.r = a
d.t = a
d.p = m
d.u = i
c.r = e
c.y = a
assert e.r.p.u.t.u.t.txt == "m"