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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.u: E = None
        self.y: G = None
        self.q: E = None
        self.x: I = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.u: E = None
        self.y: G = None
        self.q: E = None
        self.x: I = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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