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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.q: C = None
        self.r: A = None
        self.txt = txt

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

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

a.s = h
a.p = h
a.w = l
a.o = d
c.z = h
h.v = c
h.r = c
i.v = h
i.q = h
i.w = n
i.r = m
n.z = h
n.s = c
n.v = c
n.u = c
k.v = h
k.q = h
k.w = n
k.r = a
d.s = h
d.p = h
d.w = i
d.o = m
l.v = h
l.q = h
l.w = n
l.r = m
m.s = h
m.p = h
m.w = i
m.o = d
assert l.r.w.r.o.s.v.z.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.q: C = None
        self.r: A = None
        self.txt = txt

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

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

a.s = h
a.p = h
a.w = l
a.o = d
c.z = h
h.v = c
h.r = c
i.v = h
i.q = h
i.w = n
i.r = m
n.z = h
n.s = c
n.v = c
n.u = c
k.v = h
k.q = h
k.w = n
k.r = a
d.s = h
d.p = h
d.w = i
d.o = m
l.v = h
l.q = h
l.w = n
l.r = m
m.s = h
m.p = h
m.w = i
m.o = d
assert l.r.w.r.o.s.v.z.r.z.txt == "h"