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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.z: G = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: C = None
        self.z: E = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: G = None
        self.o: A = None
        self.y: J = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.x: G = None
        self.w: G = None
        self.v: D = None
        self.r: A = None
        self.t: J = None
        self.y: B = None
        self.u: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.z: G = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: C = None
        self.z: E = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: G = None
        self.o: A = None
        self.y: J = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: D = None
        self.x: G = None
        self.w: G = None
        self.v: D = None
        self.r: A = None
        self.t: J = None
        self.y: B = None
        self.u: C = None
        self.o: D = None
        self.txt = txt

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

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

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