class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.t: G = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.o: A = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: G = None
        self.w: A = None
        self.t: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: C = None
        self.o: A = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: G = None
        self.w: A = None
        self.t: C = None
        self.txt = txt

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

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