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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: F = None
        self.q: H = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.x: B = None
        self.o: A = None
        self.w: D = None
        self.q: A = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: G = None
        self.z: A = None
        self.o: J = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.x: F = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: B = None
        self.t: F = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: F = None
        self.q: H = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.x: B = None
        self.o: A = None
        self.w: D = None
        self.q: A = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: G = None
        self.z: A = None
        self.o: J = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.x: F = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: B = None
        self.t: F = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

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