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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.y: H = None
        self.r: A = None
        self.x: E = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: E = None
        self.z: F = None
        self.v: A = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: B = None
        self.v: H = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: F = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.y: F = None
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.y: H = None
        self.r: A = None
        self.x: E = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: E = None
        self.z: F = None
        self.v: A = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: B = None
        self.v: H = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: F = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.y: F = None
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

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