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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: A = None
        self.r: A = None
        self.s: D = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: B = None
        self.x: A = None
        self.v: C = None
        self.txt = txt

m = A("m")
b = B("b")
f = C("f")
i = D("i")
c = E("c")
k = F("k")
h = G("h")
g = H("g")
n = H("n")

m.r = h
m.t = b
m.q = n
m.w = n
m.o = k
m.z = f
b.z = k
b.o = k
b.u = g
b.s = f
f.p = k
f.y = m
f.r = m
f.s = i
f.w = n
i.p = c
c.t = k
k.r = f
k.v = b
h.z = n
h.x = m
h.v = k
h.u = b
h.r = c
h.t = c
g.p = k
g.y = b
g.x = m
g.v = f
n.p = k
n.y = b
n.x = m
n.v = f
assert n.y.u.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: B = None
        self.q: H = None
        self.o: F = None
        self.w: H = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: A = None
        self.r: A = None
        self.s: D = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: B = None
        self.x: A = None
        self.v: C = None
        self.txt = txt

m = A("m")
b = B("b")
f = C("f")
i = D("i")
c = E("c")
k = F("k")
h = G("h")
g = H("g")
n = H("n")

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