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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.r: F = None
        self.s: E = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

l = A("l")
j = B("j")
e = C("e")
k = D("k")
i = E("i")
g = F("g")
m = B("m")
f = F("f")
c = D("c")

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.r: F = None
        self.s: E = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

l = A("l")
j = B("j")
e = C("e")
k = D("k")
i = E("i")
g = F("g")
m = B("m")
f = F("f")
c = D("c")

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