class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.v: E = None
        self.x: G = None
        self.z: I = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: H = None
        self.x: H = None
        self.q: E = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: A = None
        self.o: B = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: D = None
        self.u: F = None
        self.p: I = None
        self.w: E = None
        self.x: A = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

f.p = k
f.y = d
f.v = d
f.q = d
f.x = h
f.o = h
f.z = l
e.o = l
e.w = d
k.x = m
k.w = m
k.z = f
k.t = l
k.u = l
k.q = l
k.p = n
k.y = h
k.v = b
g.t = n
g.u = m
g.x = m
g.r = m
g.q = d
d.v = f
d.r = f
b.r = e
b.o = e
b.q = e
b.w = f
b.t = g
h.x = f
m.s = d
m.w = d
m.o = g
m.u = b
m.p = l
m.q = l
m.x = f
l.r = k
n.u = h
n.v = k
n.p = g
n.r = l
assert l.r.y.x.z.r.u.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.v: E = None
        self.x: G = None
        self.z: I = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: H = None
        self.x: H = None
        self.q: E = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: A = None
        self.o: B = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: D = None
        self.u: F = None
        self.p: I = None
        self.w: E = None
        self.x: A = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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