class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.x: H = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.w: D = None
        self.o: D = None
        self.q: E = None
        self.s: E = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: G = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

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

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

h.u = j
h.x = k
c.o = l
c.p = a
a.q = m
j.t = h
j.s = l
g.v = b
g.t = b
g.s = b
g.o = l
g.x = k
l.u = a
l.x = a
l.w = j
l.o = j
l.q = b
l.s = g
l.y = h
l.v = h
e.x = c
e.v = m
e.t = m
e.y = k
k.y = m
k.v = e
k.q = b
b.v = g
b.t = g
b.s = g
b.o = l
b.x = k
m.x = c
m.v = e
m.t = e
m.y = k
assert k.y.v.x.p.q.x.o.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.x: H = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.w: D = None
        self.o: D = None
        self.q: E = None
        self.s: E = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: G = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

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

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

h.u = j
h.x = k
c.o = l
c.p = a
a.q = m
j.t = h
j.s = l
g.v = b
g.t = b
g.s = b
g.o = l
g.x = k
l.u = a
l.x = a
l.w = j
l.o = j
l.q = b
l.s = g
l.y = h
l.v = h
e.x = c
e.v = m
e.t = m
e.y = k
k.y = m
k.v = e
k.q = b
b.v = g
b.t = g
b.s = g
b.o = l
b.x = k
m.x = c
m.v = e
m.t = e
m.y = k
assert k.y.v.x.p.q.x.o.q.x.txt == "k"