class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: E = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.s: A = None
        self.p: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.x: B = None
        self.t: A = None
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
d = D("d")
l = E("l")
k = F("k")
a = C("a")

m.v = d
m.x = l
m.q = l
m.o = f
f.u = k
f.r = k
f.z = k
f.o = l
f.x = h
f.w = d
h.o = m
h.s = m
h.x = a
h.p = k
h.r = l
d.o = m
d.t = m
d.u = h
d.x = f
d.w = a
l.s = d
k.u = h
a.o = m
a.s = m
a.x = h
a.p = k
a.r = l
assert l.s.x.w.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: E = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.s: A = None
        self.p: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.x: B = None
        self.t: A = None
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
d = D("d")
l = E("l")
k = F("k")
a = C("a")

m.v = d
m.x = l
m.q = l
m.o = f
f.u = k
f.r = k
f.z = k
f.o = l
f.x = h
f.w = d
h.o = m
h.s = m
h.x = a
h.p = k
h.r = l
d.o = m
d.t = m
d.u = h
d.x = f
d.w = a
l.s = d
k.u = h
a.o = m
a.s = m
a.x = h
a.p = k
a.r = l
assert l.s.x.w.o.q.txt == "l"