class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: J = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: C = None
        self.r: G = None
        self.o: H = None
        self.x: A = None
        self.w: J = None
        self.q: J = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: D = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: A = None
        self.w: G = None
        self.z: J = None
        self.p: A = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.z: G = None
        self.o: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: C = None
        self.r: G = None
        self.o: H = None
        self.x: A = None
        self.w: J = None
        self.q: J = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: D = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: A = None
        self.w: G = None
        self.z: J = None
        self.p: A = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.z: G = None
        self.o: A = None
        self.txt = txt

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

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

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