class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.q: C = None
        self.x: I = None
        self.o: F = None
        self.y: A = None
        self.u: I = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: J = None
        self.p: I = None
        self.v: A = None
        self.r: H = None
        self.t: A = None
        self.s: J = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.s: B = None
        self.u: H = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.o: E = None
        self.q: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.q: C = None
        self.x: I = None
        self.o: F = None
        self.y: A = None
        self.u: I = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: B = None
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: J = None
        self.p: I = None
        self.v: A = None
        self.r: H = None
        self.t: A = None
        self.s: J = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.s: B = None
        self.u: H = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.o: E = None
        self.q: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: F = None
        self.txt = txt

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

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