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

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

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

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

h = A("h")
i = B("i")
l = C("l")
c = D("c")
g = C("g")
e = D("e")
n = B("n")
j = D("j")
k = B("k")
m = C("m")

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

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

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

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

h = A("h")
i = B("i")
l = C("l")
c = D("c")
g = C("g")
e = D("e")
n = B("n")
j = D("j")
k = B("k")
m = C("m")

h.r = j
h.u = g
h.q = m
h.w = c
i.u = g
i.p = l
i.s = k
i.r = k
l.r = k
l.o = m
l.q = e
c.t = h
c.v = m
c.x = m
g.r = k
g.o = l
g.q = c
e.t = h
e.v = m
e.x = l
n.u = m
n.p = l
n.s = i
n.r = i
j.t = h
j.v = g
j.x = m
k.u = m
k.p = m
k.s = i
k.r = n
m.r = i
m.o = g
m.q = e
assert k.s.s.s.u.o.r.r.p.r.u.txt == "m"