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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

m.w = k
m.o = e
k.y = e
k.s = e
k.t = a
j.y = a
a.w = j
a.s = e
a.y = e
e.p = h
e.y = k
h.y = a
h.o = a
b.y = a
i.w = j
i.s = e
i.y = e
g.y = a
g.o = i
assert a.y.p.o.txt == "a"