class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.z: G = None
        self.o: E = None
        self.q: C = None
        self.r: E = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.x: F = None
        self.r: A = None
        self.p: F = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: A = None
        self.s: H = None
        self.r: G = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.x: F = None
        self.r: A = None
        self.p: F = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: A = None
        self.s: H = None
        self.r: G = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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