class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.s: B = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.u: D = None
        self.p: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.u: D = None
        self.p: B = None
        self.t: A = None
        self.txt = txt

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

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

m.y = a
m.p = a
m.s = a
m.o = a
m.w = g
a.s = g
d.t = k
d.u = g
l.t = a
l.u = a
l.v = d
l.x = g
k.w = e
k.v = a
k.p = a
k.u = l
k.t = m
n.u = l
n.o = k
g.t = e
g.u = d
e.w = k
e.v = a
e.p = a
e.u = l
e.t = m
i.t = a
i.u = a
i.v = d
i.x = g
assert a.s.t.u.v.t.u.x.txt == "g"