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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

f = A("f")
h = B("h")
c = C("c")
b = D("b")
j = B("j")
n = C("n")
k = B("k")
d = D("d")

f.z = d
f.p = b
h.p = f
h.t = f
h.o = n
h.u = b
c.v = f
c.y = f
b.x = f
b.p = h
b.r = d
j.p = f
j.t = f
j.o = c
j.u = b
n.v = f
n.y = f
k.p = f
k.t = f
k.o = n
k.u = b
d.x = f
d.p = k
d.r = b
assert f.p.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.txt = txt

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

f = A("f")
h = B("h")
c = C("c")
b = D("b")
j = B("j")
n = C("n")
k = B("k")
d = D("d")

f.z = d
f.p = b
h.p = f
h.t = f
h.o = n
h.u = b
c.v = f
c.y = f
b.x = f
b.p = h
b.r = d
j.p = f
j.t = f
j.o = c
j.u = b
n.v = f
n.y = f
k.p = f
k.t = f
k.o = n
k.u = b
d.x = f
d.p = k
d.r = b
assert f.p.p.o.txt == "n"