class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.t: B = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.p: G = None
        self.o: C = None
        self.z: G = None
        self.v: D = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.p: G = None
        self.o: C = None
        self.z: G = None
        self.v: D = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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