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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.o: F = None
        self.y: F = None
        self.w: D = None
        self.u: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.z: G = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.o: D = None
        self.r: D = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
n = C("n")
m = D("m")
h = E("h")
b = F("b")
c = G("c")
d = D("d")

l.p = e
e.z = m
e.w = m
e.q = b
e.o = b
e.y = b
e.u = l
e.p = h
n.r = c
n.w = b
m.q = h
m.o = h
m.r = c
m.z = c
m.t = c
h.y = d
h.p = d
h.r = d
h.v = d
h.o = m
h.q = e
b.v = l
b.o = n
c.z = l
c.x = b
c.v = n
c.q = n
d.q = h
d.o = h
d.r = c
d.z = c
d.t = c
assert c.z.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.o: F = None
        self.y: F = None
        self.w: D = None
        self.u: A = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.z: G = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: D = None
        self.o: D = None
        self.r: D = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
n = C("n")
m = D("m")
h = E("h")
b = F("b")
c = G("c")
d = D("d")

l.p = e
e.z = m
e.w = m
e.q = b
e.o = b
e.y = b
e.u = l
e.p = h
n.r = c
n.w = b
m.q = h
m.o = h
m.r = c
m.z = c
m.t = c
h.y = d
h.p = d
h.r = d
h.v = d
h.o = m
h.q = e
b.v = l
b.o = n
c.z = l
c.x = b
c.v = n
c.q = n
d.q = h
d.o = h
d.r = c
d.z = c
d.t = c
assert c.z.p.p.txt == "h"