class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: J = None
        self.w: J = None
        self.z: H = None
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: H = None
        self.v: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: J = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: J = None
        self.w: J = None
        self.z: H = None
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: H = None
        self.v: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.s: J = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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