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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.v: B = None
        self.o: H = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

k.o = l
k.p = b
g.y = b
g.w = k
g.p = k
g.x = d
n.q = g
n.v = g
n.y = k
n.o = b
n.p = f
f.v = k
f.p = c
i.o = b
i.z = b
i.w = g
i.r = n
l.z = k
l.v = i
l.y = c
l.p = g
l.w = b
c.o = i
c.w = b
b.q = l
d.p = b
d.q = n
d.v = n
assert n.p.p.w.q.z.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.v: B = None
        self.o: H = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

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