class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.z: H = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: C = None
        self.o: I = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

c.r = j
g.t = d
g.w = l
g.z = j
g.r = a
k.p = a
k.o = e
k.q = d
k.z = d
k.v = m
k.s = m
k.u = m
k.t = g
k.r = l
l.p = c
l.q = k
l.o = a
l.r = m
m.s = k
m.y = c
m.o = l
m.v = j
e.v = l
e.p = l
e.q = m
d.s = a
d.o = l
d.w = m
j.u = d
j.s = l
j.v = k
a.x = g
a.o = l
assert m.o.o.o.q.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.z: H = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: C = None
        self.o: I = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

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