class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.y: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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