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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.p: B = None
        self.w: H = None
        self.o: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: G = None
        self.x: G = None
        self.u: C = None
        self.v: D = None
        self.w: G = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.p: B = None
        self.w: H = None
        self.o: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: G = None
        self.x: G = None
        self.u: C = None
        self.v: D = None
        self.w: G = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

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

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