class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: F = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: F = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

f.v = n
f.s = n
i.u = f
i.r = h
i.x = n
i.v = n
n.z = a
e.o = f
e.p = a
m.y = a
c.o = f
c.q = f
c.w = n
c.p = n
c.x = m
a.y = m
h.o = f
h.q = f
h.w = n
h.p = n
h.x = a
assert a.y.y.y.y.y.y.y.txt == "m"