class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: C = None
        self.u: B = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.p: E = None
        self.r: F = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.p: E = None
        self.r: F = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

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

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