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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.r: A = None
        self.p: J = None
        self.q: I = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.v: B = None
        self.y: G = None
        self.s: G = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: E = None
        self.p: D = None
        self.q: H = None
        self.w: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: B = None
        self.o: D = None
        self.r: F = None
        self.p: B = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: G = None
        self.r: A = None
        self.p: J = None
        self.q: I = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.v: B = None
        self.y: G = None
        self.s: G = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: E = None
        self.p: D = None
        self.q: H = None
        self.w: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: B = None
        self.o: D = None
        self.r: F = None
        self.p: B = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

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