class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: F = None
        self.q: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: F = None
        self.q: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

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

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