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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.p: B = None
        self.r: F = None
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.p: B = None
        self.r: F = None
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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