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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

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

c.w = j
c.v = j
c.u = e
c.x = k
l.r = m
b.t = a
b.o = a
b.u = c
h.y = k
h.w = m
h.o = e
k.r = h
a.t = b
a.o = b
a.u = e
e.w = k
e.v = k
e.u = c
e.x = l
m.y = j
m.w = h
m.o = e
j.r = i
i.y = l
i.w = h
i.o = e
assert c.x.r.w.y.r.o.v.r.txt == "h"