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

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

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

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

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

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

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

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

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

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

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

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

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

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

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