class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.y: F = None
        self.o: F = None
        self.x: G = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.u: C = None
        self.s: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

h.p = i
h.t = i
h.y = e
h.o = e
h.s = e
h.x = g
i.o = e
n.r = f
n.v = f
n.t = b
n.z = d
d.o = f
d.q = c
d.x = c
f.x = e
f.s = e
f.z = e
f.p = a
f.u = n
e.p = i
g.z = i
g.t = c
g.u = e
g.q = f
g.p = n
g.r = n
b.o = c
b.x = c
b.q = f
c.x = e
c.s = e
c.z = e
c.p = n
c.u = a
a.r = f
a.t = d
a.z = d
a.v = c
assert n.r.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: B = None
        self.y: F = None
        self.o: F = None
        self.x: G = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.u: C = None
        self.s: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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