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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.w: D = None
        self.o: J = None
        self.q: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.w: A = None
        self.u: G = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.t: A = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.w: D = None
        self.o: J = None
        self.q: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.w: A = None
        self.u: G = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.t: A = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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