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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.x: G = None
        self.u: E = None
        self.v: E = None
        self.o: G = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.q: H = None
        self.u: A = None
        self.p: A = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.z: A = None
        self.y: G = None
        self.v: F = None
        self.o: D = None
        self.u: H = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.x: G = None
        self.u: E = None
        self.v: E = None
        self.o: G = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.q: H = None
        self.u: A = None
        self.p: A = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.z: A = None
        self.y: G = None
        self.v: F = None
        self.o: D = None
        self.u: H = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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