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

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

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

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

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

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

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

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

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

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

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

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

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

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

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