class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: C = None
        self.w: C = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.q: G = None
        self.w: C = None
        self.v: F = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: F = None
        self.q: G = None
        self.w: C = None
        self.v: F = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

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