class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: E = None
        self.w: E = None
        self.z: D = None
        self.o: C = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.s: G = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: G = None
        self.p: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.u: E = None
        self.v: A = None
        self.x: H = None
        self.p: H = None
        self.t: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.s: G = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: G = None
        self.p: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.u: E = None
        self.v: A = None
        self.x: H = None
        self.p: H = None
        self.t: C = None
        self.y: A = None
        self.txt = txt

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

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

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