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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.s: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.s: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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