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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

g = A("g")
f = B("f")
j = C("j")
h = D("h")
c = E("c")
n = F("n")
k = G("k")
i = H("i")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

g = A("g")
f = B("f")
j = C("j")
h = D("h")
c = E("c")
n = F("n")
k = G("k")
i = H("i")

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