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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: D = None
        self.t: I = None
        self.p: H = None
        self.w: I = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.z: F = None
        self.o: E = None
        self.w: F = None
        self.y: C = None
        self.r: G = None
        self.x: G = None
        self.u: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.p: I = None
        self.x: I = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: D = None
        self.t: I = None
        self.p: H = None
        self.w: I = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.z: F = None
        self.o: E = None
        self.w: F = None
        self.y: C = None
        self.r: G = None
        self.x: G = None
        self.u: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.p: I = None
        self.x: I = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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