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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

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

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

d.q = m
d.z = e
d.t = g
d.w = h
d.s = a
i.p = a
a.y = e
a.w = f
g.w = d
g.v = d
f.v = d
f.y = g
f.t = i
f.x = a
h.s = i
h.w = e
k.v = d
k.y = g
k.t = i
k.x = a
m.v = d
m.y = g
m.t = i
m.x = a
e.s = i
e.w = h
assert i.p.y.s.p.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.t: D = None
        self.w: F = None
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

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

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

d.q = m
d.z = e
d.t = g
d.w = h
d.s = a
i.p = a
a.y = e
a.w = f
g.w = d
g.v = d
f.v = d
f.y = g
f.t = i
f.x = a
h.s = i
h.w = e
k.v = d
k.y = g
k.t = i
k.x = a
m.v = d
m.y = g
m.t = i
m.x = a
e.s = i
e.w = h
assert i.p.y.s.p.y.w.txt == "h"