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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.s: I = None
        self.x: D = None
        self.u: A = None
        self.r: I = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.t: D = None
        self.x: H = None
        self.p: B = None
        self.r: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: G = None
        self.y: B = None
        self.t: B = None
        self.u: H = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.s: I = None
        self.x: D = None
        self.u: A = None
        self.r: I = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.t: D = None
        self.x: H = None
        self.p: B = None
        self.r: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: G = None
        self.y: B = None
        self.t: B = None
        self.u: H = None
        self.q: F = None
        self.p: F = None
        self.txt = txt

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

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