class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.o: C = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.s: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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

m.y = f
m.x = n
m.o = i
m.p = l
f.s = e
f.u = i
i.q = m
i.u = l
i.s = n
i.v = f
e.s = f
e.p = f
l.o = m
l.x = n
n.t = i
n.q = i
n.s = l
b.s = f
b.p = f
assert f.s.s.s.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.o: C = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.s: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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

m.y = f
m.x = n
m.o = i
m.p = l
f.s = e
f.u = i
i.q = m
i.u = l
i.s = n
i.v = f
e.s = f
e.p = f
l.o = m
l.x = n
n.t = i
n.q = i
n.s = l
b.s = f
b.p = f
assert f.s.s.s.p.u.txt == "i"