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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: C = None
        self.t: F = None
        self.u: D = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: C = None
        self.t: F = None
        self.u: D = None
        self.o: F = None
        self.y: A = None
        self.txt = txt

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

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

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