class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.t: D = None
        self.v: D = None
        self.s: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: G = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.x: D = None
        self.y: E = None
        self.txt = txt

g = A("g")
k = B("k")
j = C("j")
m = D("m")
d = E("d")
n = F("n")
b = G("b")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: G = None
        self.x: A = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.x: D = None
        self.y: E = None
        self.txt = txt

g = A("g")
k = B("k")
j = C("j")
m = D("m")
d = E("d")
n = F("n")
b = G("b")

g.o = j
g.z = m
g.t = m
g.v = m
g.s = m
g.p = n
k.r = g
k.x = g
k.t = b
k.p = j
j.p = b
m.s = d
m.x = j
d.y = n
d.p = m
d.q = m
n.z = m
b.r = n
b.u = g
b.x = m
b.y = d
assert j.p.y.y.txt == "n"