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

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

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

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

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

m = A("m")
j = B("j")
n = C("n")
c = D("c")
e = E("e")
a = D("a")
b = D("b")
d = E("d")

m.q = n
m.x = n
m.u = d
m.v = b
m.z = c
j.t = m
j.p = m
n.u = c
n.s = e
n.v = a
c.v = m
c.y = m
c.u = n
c.s = j
c.o = d
e.v = m
e.y = b
e.p = b
e.o = n
e.x = n
a.v = m
a.y = m
a.u = n
a.s = j
a.o = d
b.v = m
b.y = m
b.u = n
b.s = j
b.o = d
d.v = m
d.y = a
d.o = n
d.x = n
d.p = c
assert e.y.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.v: D = None
        self.z: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

m = A("m")
j = B("j")
n = C("n")
c = D("c")
e = E("e")
a = D("a")
b = D("b")
d = E("d")

m.q = n
m.x = n
m.u = d
m.v = b
m.z = c
j.t = m
j.p = m
n.u = c
n.s = e
n.v = a
c.v = m
c.y = m
c.u = n
c.s = j
c.o = d
e.v = m
e.y = b
e.p = b
e.o = n
e.x = n
a.v = m
a.y = m
a.u = n
a.s = j
a.o = d
b.v = m
b.y = m
b.u = n
b.s = j
b.o = d
d.v = m
d.y = a
d.o = n
d.x = n
d.p = c
assert e.y.v.u.txt == "d"