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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: F = None
        self.y: H = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: G = None
        self.v: C = None
        self.z: C = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.u: B = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.v: F = None
        self.txt = txt

e = A("e")
n = B("n")
d = C("d")
c = D("c")
b = E("b")
g = F("g")
a = G("a")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: F = None
        self.y: H = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: G = None
        self.v: C = None
        self.z: C = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.u: B = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.v: F = None
        self.txt = txt

e = A("e")
n = B("n")
d = C("d")
c = D("c")
b = E("b")
g = F("g")
a = G("a")
k = H("k")

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