class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: I = None
        self.u: H = None
        self.w: C = None
        self.o: H = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: I = None
        self.q: H = None
        self.z: E = None
        self.t: F = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: I = None
        self.u: H = None
        self.w: C = None
        self.o: H = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: I = None
        self.q: H = None
        self.z: E = None
        self.t: F = None
        self.s: H = None
        self.txt = txt

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

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

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

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