class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.t: B = None
        self.s: I = None
        self.p: G = None
        self.z: I = None
        self.r: F = None
        self.v: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: G = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.z: B = None
        self.t: F = None
        self.w: I = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: G = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.z: B = None
        self.t: F = None
        self.w: I = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: B = None
        self.txt = txt

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

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

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