class A:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.p: J = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: H = None
        self.t: G = None
        self.u: D = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: G = None
        self.r: G = None
        self.z: C = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.p: J = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: H = None
        self.t: G = None
        self.u: D = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: G = None
        self.r: G = None
        self.z: C = None
        self.y: I = None
        self.txt = txt

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

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