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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.v: B = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.v: B = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

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

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

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

h.s = c
a.p = l
k.w = m
k.p = m
k.z = h
k.o = h
k.v = j
l.u = a
l.p = e
l.v = e
l.t = c
l.r = h
e.r = k
j.p = l
m.w = k
m.p = k
m.z = h
m.o = h
m.v = a
c.u = d
c.p = e
c.v = e
c.t = l
c.r = h
d.p = c
assert c.v.r.o.s.txt == "c"