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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: G = None
        self.x: H = None
        self.o: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.o: E = None
        self.x: G = None
        self.z: A = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: G = None
        self.x: H = None
        self.o: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.o: E = None
        self.x: G = None
        self.z: A = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: H = None
        self.txt = txt

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

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

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