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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.z: I = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: I = None
        self.u: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: G = None
        self.v: B = None
        self.r: G = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.z: I = None
        self.t: A = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: I = None
        self.u: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: G = None
        self.v: B = None
        self.r: G = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

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

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