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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: A = None
        self.y: E = None
        self.t: G = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: A = None
        self.y: E = None
        self.t: G = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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