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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: D = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

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

l.v = m
l.r = c
k.x = m
k.y = i
h.s = c
h.t = i
h.o = f
h.r = n
f.r = l
f.p = c
f.y = c
f.z = n
a.x = k
a.y = h
m.x = a
m.y = h
e.s = n
e.r = n
e.t = h
e.o = f
c.r = l
c.p = f
c.y = f
c.z = f
n.r = l
n.p = c
n.z = c
n.y = f
i.s = c
i.t = e
i.o = f
i.r = n
assert n.y.y.r.v.x.txt == "a"