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

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

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

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

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

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

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

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

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

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

e.r = b
e.p = k
e.o = f
e.v = d
l.r = e
c.z = h
c.x = h
c.u = f
c.w = a
i.p = l
i.o = d
i.t = h
d.r = k
a.z = h
a.w = h
a.x = h
a.u = f
f.p = b
f.o = d
f.t = h
b.r = k
k.r = b
k.p = e
k.o = i
k.v = d
h.z = a
h.w = a
h.u = i
h.x = c
assert a.u.t.x.txt == "c"