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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: J = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: I = None
        self.w: A = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: J = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: I = None
        self.w: A = None
        self.r: B = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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