class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: J = None
        self.z: I = None
        self.s: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: I = None
        self.r: A = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: I = None
        self.x: B = None
        self.t: F = None
        self.s: H = None
        self.p: C = None
        self.u: F = None
        self.q: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: D = None
        self.q: H = None
        self.s: E = None
        self.y: I = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: I = None
        self.r: A = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: I = None
        self.x: B = None
        self.t: F = None
        self.s: H = None
        self.p: C = None
        self.u: F = None
        self.q: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: D = None
        self.q: H = None
        self.s: E = None
        self.y: I = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

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

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