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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

m.y = f
m.q = d
m.w = d
m.v = d
m.x = d
m.s = g
m.t = g
m.r = a
m.o = l
n.w = m
n.u = a
k.p = a
l.p = m
a.r = g
a.y = g
a.w = c
c.v = m
c.o = f
g.o = n
g.s = n
g.q = l
g.p = l
g.w = d
g.t = m
d.p = c
f.s = g
f.w = g
assert a.y.w.p.o.s.q.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: H = None
        self.w: H = None
        self.s: G = None
        self.v: H = None
        self.r: E = None
        self.o: D = None
        self.t: G = None
        self.x: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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