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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: J = None
        self.x: G = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: I = None
        self.y: J = None
        self.r: J = None
        self.p: H = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: J = None
        self.t: C = None
        self.s: C = None
        self.y: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: E = None
        self.q: C = None
        self.o: B = None
        self.t: E = None
        self.p: E = None
        self.y: I = None
        self.s: B = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

d = A("d")
n = B("n")
f = C("f")
a = D("a")
k = E("k")
i = F("i")
e = G("e")
l = H("l")
m = I("m")
c = J("c")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: J = None
        self.x: G = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: I = None
        self.y: J = None
        self.r: J = None
        self.p: H = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: J = None
        self.t: C = None
        self.s: C = None
        self.y: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: E = None
        self.q: C = None
        self.o: B = None
        self.t: E = None
        self.p: E = None
        self.y: I = None
        self.s: B = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

d = A("d")
n = B("n")
f = C("f")
a = D("a")
k = E("k")
i = F("i")
e = G("e")
l = H("l")
m = I("m")
c = J("c")

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