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

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

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

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

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

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

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

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

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

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

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