class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: H = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: A = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.s: H = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: H = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: A = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.s: H = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: H = None
        self.txt = txt

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

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

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