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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: H = None
        self.z: B = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: C = None
        self.v: C = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: J = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: H = None
        self.o: J = None
        self.p: J = None
        self.z: J = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: H = None
        self.z: B = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: C = None
        self.v: C = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: J = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: H = None
        self.o: J = None
        self.p: J = None
        self.z: J = None
        self.txt = txt

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

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

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