class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.v: E = None
        self.t: B = None
        self.u: H = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.v: G = None
        self.q: E = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.x: B = None
        self.z: B = None
        self.s: D = None
        self.q: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.v: G = None
        self.q: E = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.x: B = None
        self.z: B = None
        self.s: D = None
        self.q: D = None
        self.r: H = None
        self.txt = txt

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

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

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