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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

n.u = a
n.t = i
n.x = i
b.q = n
b.s = m
b.z = l
b.o = a
m.s = i
l.r = b
l.t = a
l.y = i
i.x = m
a.y = m
a.r = l
e.y = m
e.r = l
assert m.s.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: E = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

n.u = a
n.t = i
n.x = i
b.q = n
b.s = m
b.z = l
b.o = a
m.s = i
l.r = b
l.t = a
l.y = i
i.x = m
a.y = m
a.r = l
e.y = m
e.r = l
assert m.s.x.s.x.txt == "m"