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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.r: B = None
        self.p: B = None
        self.x: F = None
        self.y: F = None
        self.w: D = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: F = None
        self.s: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.r: B = None
        self.p: B = None
        self.x: F = None
        self.y: F = None
        self.w: D = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: F = None
        self.s: B = None
        self.p: F = None
        self.txt = txt

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

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