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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.q: B = None
        self.t: A = None
        self.txt = txt

i = A("i")
j = B("j")
m = C("m")
n = D("n")
e = E("e")
f = B("f")

i.y = n
i.t = n
i.p = e
j.y = m
m.o = f
n.o = i
n.t = i
n.u = e
e.u = i
e.t = i
e.s = n
e.q = j
f.y = m
assert e.s.u.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.q: B = None
        self.t: A = None
        self.txt = txt

i = A("i")
j = B("j")
m = C("m")
n = D("n")
e = E("e")
f = B("f")

i.y = n
i.t = n
i.p = e
j.y = m
m.o = f
n.o = i
n.t = i
n.u = e
e.u = i
e.t = i
e.s = n
e.q = j
f.y = m
assert e.s.u.s.o.txt == "i"