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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.z: A = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.v: G = None
        self.x: A = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: F = None
        self.z: A = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.v: G = None
        self.x: A = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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