class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: F = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: D = None
        self.p: C = None
        self.w: H = None
        self.y: E = None
        self.t: A = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: E = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: D = None
        self.p: C = None
        self.w: H = None
        self.y: E = None
        self.t: A = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: E = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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