class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: I = None
        self.u: B = None
        self.r: G = None
        self.s: I = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: B = None
        self.t: A = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: F = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: F = None
        self.o: A = None
        self.x: A = None
        self.y: J = None
        self.r: I = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: E = None
        self.w: H = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: F = None
        self.v: B = None
        self.s: F = None
        self.r: B = None
        self.w: D = None
        self.u: C = None
        self.y: I = None
        self.z: I = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: B = None
        self.t: A = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: F = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: F = None
        self.o: A = None
        self.x: A = None
        self.y: J = None
        self.r: I = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: E = None
        self.w: H = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: F = None
        self.v: B = None
        self.s: F = None
        self.r: B = None
        self.w: D = None
        self.u: C = None
        self.y: I = None
        self.z: I = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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