class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: I = None
        self.t: D = None
        self.p: F = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: J = None
        self.o: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: C = None
        self.q: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.p: F = None
        self.w: J = None
        self.q: D = None
        self.z: F = None
        self.v: E = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.z: E = None
        self.v: F = None
        self.q: H = None
        self.x: F = None
        self.o: E = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: I = None
        self.t: D = None
        self.p: F = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: J = None
        self.o: A = None
        self.p: F = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.s: C = None
        self.q: G = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.p: F = None
        self.w: J = None
        self.q: D = None
        self.z: F = None
        self.v: E = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: F = None
        self.z: E = None
        self.v: F = None
        self.q: H = None
        self.x: F = None
        self.o: E = None
        self.r: C = None
        self.u: C = None
        self.txt = txt

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

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