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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.s: E = None
        self.r: H = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: D = None
        self.x: C = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: E = None
        self.o: J = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: B = None
        self.s: G = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.r: G = None
        self.s: G = None
        self.txt = txt

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

h = A("h")
n = B("n")
g = C("g")
j = D("j")
d = E("d")
f = F("f")
i = G("i")
b = H("b")
l = I("l")
c = J("c")

h.y = d
h.t = d
h.p = n
n.q = b
n.y = b
n.s = l
n.r = l
n.p = c
n.t = h
n.x = i
g.p = c
g.w = b
g.t = b
j.o = h
j.t = n
j.s = d
j.r = b
j.x = i
j.p = i
d.s = i
d.u = i
d.r = i
d.x = n
f.t = i
f.q = j
f.x = g
f.s = b
i.t = l
i.q = d
i.o = c
i.y = n
i.v = f
b.z = h
b.w = n
b.x = n
b.s = i
l.v = g
l.u = j
l.r = i
l.s = i
c.w = f
assert i.t.u.t.x.y.x.y.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.s: E = None
        self.r: H = None
        self.x: G = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: G = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.q: D = None
        self.x: C = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: E = None
        self.o: J = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: B = None
        self.s: G = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.r: G = None
        self.s: G = None
        self.txt = txt

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

h = A("h")
n = B("n")
g = C("g")
j = D("j")
d = E("d")
f = F("f")
i = G("i")
b = H("b")
l = I("l")
c = J("c")

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