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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.z: B = None
        self.q: D = None
        self.x: A = None
        self.p: A = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.z: B = None
        self.q: D = None
        self.x: A = None
        self.p: A = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

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