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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: E = None
        self.z: E = None
        self.q: E = None
        self.o: F = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: B = None
        self.o: E = None
        self.s: A = None
        self.u: A = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.t: A = None
        self.w: A = None
        self.q: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: E = None
        self.z: E = None
        self.q: E = None
        self.o: F = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: B = None
        self.o: E = None
        self.s: A = None
        self.u: A = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.t: A = None
        self.w: A = None
        self.q: G = None
        self.txt = txt

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

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

k.u = b
k.p = n
n.r = m
n.x = m
n.w = b
n.z = b
n.q = b
n.o = l
m.s = h
m.q = h
m.w = h
m.z = n
m.r = g
m.t = l
h.p = g
h.t = n
h.y = n
h.o = b
h.s = k
h.u = k
b.x = l
b.u = l
b.t = k
b.r = g
l.z = b
l.p = b
l.t = k
l.w = k
l.q = g
g.r = n
assert g.r.o.t.p.txt == "n"