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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: D = None
        self.r: C = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.v: E = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: D = None
        self.r: C = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.v: E = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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