class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: B = None
        self.x: D = None
        self.o: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.t: I = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: D = None
        self.t: I = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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