class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = 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.s: A = None
        self.r: B = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.t: E = None
        self.q: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.p: B = None
        self.q: B = None
        self.w: E = None
        self.z: B = None
        self.txt = txt

n = A("n")
d = B("d")
a = C("a")
c = D("c")
b = E("b")
f = F("f")
i = D("i")
h = E("h")

n.p = d
n.o = i
d.r = n
a.s = n
a.o = n
a.v = n
a.r = d
c.z = h
b.u = i
b.s = n
b.t = h
b.q = a
b.w = f
f.r = a
f.x = h
f.p = d
f.q = d
f.z = d
f.w = b
i.z = h
h.u = c
h.s = n
h.t = b
h.q = a
h.w = f
assert d.r.p.r.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = 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.s: A = None
        self.r: B = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.t: E = None
        self.q: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.p: B = None
        self.q: B = None
        self.w: E = None
        self.z: B = None
        self.txt = txt

n = A("n")
d = B("d")
a = C("a")
c = D("c")
b = E("b")
f = F("f")
i = D("i")
h = E("h")

n.p = d
n.o = i
d.r = n
a.s = n
a.o = n
a.v = n
a.r = d
c.z = h
b.u = i
b.s = n
b.t = h
b.q = a
b.w = f
f.r = a
f.x = h
f.p = d
f.q = d
f.z = d
f.w = b
i.z = h
h.u = c
h.s = n
h.t = b
h.q = a
h.w = f
assert d.r.p.r.o.z.txt == "h"