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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: I = None
        self.q: J = None
        self.z: I = None
        self.x: E = None
        self.t: B = None
        self.r: H = None
        self.u: E = None
        self.v: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: I = None
        self.w: D = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: I = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.u: D = None
        self.r: J = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: H = None
        self.s: E = None
        self.z: I = None
        self.r: H = None
        self.t: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: I = None
        self.q: J = None
        self.z: I = None
        self.x: E = None
        self.t: B = None
        self.r: H = None
        self.u: E = None
        self.v: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: I = None
        self.w: D = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: I = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.u: D = None
        self.r: J = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: H = None
        self.s: E = None
        self.z: I = None
        self.r: H = None
        self.t: C = None
        self.txt = txt

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

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