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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: H = None
        self.q: F = None
        self.y: H = None
        self.w: F = None
        self.v: A = None
        self.z: I = None
        self.t: F = None
        self.o: F = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.r: A = None
        self.t: D = None
        self.q: G = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.o: F = None
        self.v: I = None
        self.p: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.x: I = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: H = None
        self.q: F = None
        self.y: H = None
        self.w: F = None
        self.v: A = None
        self.z: I = None
        self.t: F = None
        self.o: F = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.r: A = None
        self.t: D = None
        self.q: G = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.o: F = None
        self.v: I = None
        self.p: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.x: I = None
        self.p: E = None
        self.txt = txt

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

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