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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.w: E = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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

m = A("m")
e = B("e")
b = C("b")
h = D("h")
a = E("a")
g = F("g")
c = C("c")
i = C("i")
k = E("k")
f = F("f")

m.s = k
m.q = e
e.p = a
b.y = e
b.u = e
b.p = h
b.o = m
h.z = g
h.r = e
h.w = k
h.s = k
h.q = a
a.p = h
a.o = b
a.x = c
a.u = k
g.x = f
g.t = i
c.y = e
c.u = e
c.p = h
c.o = m
i.y = e
i.u = e
i.p = h
i.o = m
k.p = h
k.o = i
k.x = b
k.u = a
f.x = g
f.t = b
assert a.o.o.s.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.w: E = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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

m = A("m")
e = B("e")
b = C("b")
h = D("h")
a = E("a")
g = F("g")
c = C("c")
i = C("i")
k = E("k")
f = F("f")

m.s = k
m.q = e
e.p = a
b.y = e
b.u = e
b.p = h
b.o = m
h.z = g
h.r = e
h.w = k
h.s = k
h.q = a
a.p = h
a.o = b
a.x = c
a.u = k
g.x = f
g.t = i
c.y = e
c.u = e
c.p = h
c.o = m
i.y = e
i.u = e
i.p = h
i.o = m
k.p = h
k.o = i
k.x = b
k.u = a
f.x = g
f.t = b
assert a.o.o.s.p.w.txt == "k"