class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: A = None
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

m = A("m")
l = B("l")
d = C("d")
h = D("h")
b = E("b")
c = D("c")
e = B("e")
n = E("n")
k = A("k")
i = A("i")

m.q = n
m.p = n
m.y = k
m.w = e
l.z = b
l.t = e
l.o = e
l.r = h
d.o = c
d.r = c
d.w = c
d.p = n
d.y = i
h.r = l
h.x = k
h.y = k
h.t = e
h.v = b
b.x = k
b.s = k
b.v = c
b.t = d
c.r = e
c.x = k
c.y = i
c.t = l
c.v = b
e.z = b
e.t = l
e.o = l
e.r = h
n.x = i
n.v = h
n.s = m
n.t = d
k.q = n
k.p = n
k.y = i
k.w = e
i.q = b
i.p = b
i.y = m
i.w = e
assert m.w.t.t.r.t.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: A = None
        self.w: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

m = A("m")
l = B("l")
d = C("d")
h = D("h")
b = E("b")
c = D("c")
e = B("e")
n = E("n")
k = A("k")
i = A("i")

m.q = n
m.p = n
m.y = k
m.w = e
l.z = b
l.t = e
l.o = e
l.r = h
d.o = c
d.r = c
d.w = c
d.p = n
d.y = i
h.r = l
h.x = k
h.y = k
h.t = e
h.v = b
b.x = k
b.s = k
b.v = c
b.t = d
c.r = e
c.x = k
c.y = i
c.t = l
c.v = b
e.z = b
e.t = l
e.o = l
e.r = h
n.x = i
n.v = h
n.s = m
n.t = d
k.q = n
k.p = n
k.y = i
k.w = e
i.q = b
i.p = b
i.y = m
i.w = e
assert m.w.t.t.r.t.r.r.txt == "l"