class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: D = None
        self.z: D = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.p: G = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.p: F = None
        self.v: J = None
        self.s: F = None
        self.o: H = None
        self.q: J = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.u: B = None
        self.o: D = None
        self.q: B = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.p: G = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.p: F = None
        self.v: J = None
        self.s: F = None
        self.o: H = None
        self.q: J = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.u: B = None
        self.o: D = None
        self.q: B = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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