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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: F = None
        self.z: E = None
        self.r: I = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: I = None
        self.x: I = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.u: B = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: F = None
        self.z: E = None
        self.r: I = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: I = None
        self.x: I = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.u: B = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

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

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

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

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