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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: H = None
        self.q: G = None
        self.y: E = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: H = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.s: E = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: H = None
        self.q: G = None
        self.y: E = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: H = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.s: E = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

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

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