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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.o: E = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

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

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

m = A("m")
e = B("e")
b = C("b")
i = D("i")
j = E("j")
h = B("h")
a = C("a")
l = E("l")

m.v = i
m.t = i
m.x = l
e.y = m
e.z = m
e.x = i
e.o = j
e.w = h
b.u = i
i.u = b
i.y = b
i.x = l
i.q = m
j.t = b
j.u = a
j.p = a
j.v = h
h.y = m
h.z = m
h.x = i
h.o = j
h.w = e
a.u = i
l.t = b
l.u = b
l.p = a
l.v = e
assert l.p.u.x.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.o: E = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

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

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

m = A("m")
e = B("e")
b = C("b")
i = D("i")
j = E("j")
h = B("h")
a = C("a")
l = E("l")

m.v = i
m.t = i
m.x = l
e.y = m
e.z = m
e.x = i
e.o = j
e.w = h
b.u = i
i.u = b
i.y = b
i.x = l
i.q = m
j.t = b
j.u = a
j.p = a
j.v = h
h.y = m
h.z = m
h.x = i
h.o = j
h.w = e
a.u = i
l.t = b
l.u = b
l.p = a
l.v = e
assert l.p.u.x.p.u.txt == "i"