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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.s: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

m.o = l
m.v = g
m.u = e
g.p = m
g.w = e
g.s = d
g.q = d
i.x = e
k.s = d
k.u = e
l.x = d
l.q = d
l.p = k
l.w = k
d.x = l
d.u = l
e.p = m
e.w = g
e.s = d
e.q = d
assert m.u.w.p.o.p.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.s: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

m.o = l
m.v = g
m.u = e
g.p = m
g.w = e
g.s = d
g.q = d
i.x = e
k.s = d
k.u = e
l.x = d
l.q = d
l.p = k
l.w = k
d.x = l
d.u = l
e.p = m
e.w = g
e.s = d
e.q = d
assert m.u.w.p.o.p.s.x.txt == "l"